import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'dva';
import { Input,Button,Select,message,Icon} from 'antd';
import styles from '../pointroad/index.less';
const Option = Select.Option;
import {TimeSpan} from '../../utils';

export default connect(({ privilege, loading }) => ({ privilege, loading }))(({privilege, dispatch,loading})=>
    <div className={styles.container}><PagesPOST dispatch={dispatch} {...privilege} loading={loading.global}/></div>);

class PagesPOST extends React.Component {
    componentWillMount () {
        this.props.dispatch({
            type:'privilege/getprivilegeList',payload:{id:localStorage.getItem('id')},
        });
    }
    render (){
        let {listData} = this.props;
        listData = listData?listData:{};
        let htmlText = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+listData.message;
        return (
            <div style={{padding:30}}>
                <h2 style={{borderBottom:'1px solid #aaa'}}><Icon type="notification" style={{marginRight:20,color:'#aaa'}} />公告</h2>
                <div style={{color:'#1890ff',fontSize:18,marginBottom:10}}>{listData.titleText}</div>
                <div style={{color:"#1890ff"}}>
                    {listData.userName}
                    <span style={{marginLeft:10,color:'#aaa'}}>{TimeSpan(listData.creatTime)}</span>
                </div>
                <div style={{marginTop:20}}>
                    <div dangerouslySetInnerHTML={{__html:htmlText}}></div>
                </div>
            </div>

        );
    }
}